package com.lean.android.ad.duration

import android.os.SystemClock

internal class DurationWatcher {
    private var cacheTime: Long = 0

    fun start() {
        cacheTime = SystemClock.uptimeMillis()
    }

    fun stop(durationCallback: (Long) -> Unit = {}) {
        val duration = SystemClock.uptimeMillis() - cacheTime
        durationCallback(duration)
    }

}